/* 
 *   Date       Developer         Description
 *   2017-09-07 周成功      新建
 * 
 *
 *   Classname:  com.titan.demo.commons.domain.Player1MoneyDomain
 * 
 *   The source code contained in this listing is proprietary to
 *   Baby Footmarks studio.
 * 
 *   Unauthorized copying, adaptation, distribution, use, or display
 *   is strictly prohibited.
 *   This software is Copyright 2017 Baby Footmarks studio.
 */
package com.titan.demo.commons.domain;

import java.io.IOException;
import java.util.Date;
import java.util.Map;

import com.titan.core.base.BaseDomain;
import com.titan.core.utils.data.FormatUtils;
import com.titan.core.utils.data.StringUtils;
import com.titan.core.utils.object.PropertyDescriptor;
import com.titan.core.utils.object.Variant;


/**
 * 根据表player1_money创建的Domain类
 * 
 * @author 周成功
 * 
 */
public class Player1MoneyDomain extends BaseDomain {
    private static final long serialVersionUID = 1L;

    private String id;   // 主键
    private Long createtime;   // 记账时间毫秒数，用于排序
    private String play;   // 游戏： play_stake, play_stake_pj, play_stake_pk, play_stake_pm, play_stake_3d1, play_stake_3d2
    private String playid;   // 对应游戏记录id
    private Integer money_old;   // 变动前余额，单位：分
    private Integer money_var;   // 余额变动，单位：分
    private Integer money_new;   // 变动后余额，单位：分
    private String create_name;   // 记录创建人
    private Date create_dt;   // 记录创建时间
    private String update_name;   // 记录最后修改人
    private Date update_dt;   // 记录最后修改时间
    private String delete_flag;   // 记录删除标识
    private String delete_name;   // 记录删除人
    private Date delete_dt;   // 记录删除时间


    public Player1MoneyDomain() {
    }
    public Player1MoneyDomain(Map data) {
        if(data==null) {
            return;
        }
        try {
            java.util.Iterator<?> iterator = data.keySet().iterator();
            while(iterator.hasNext()) {
                Object property = iterator.next();
                String key = FormatUtils.toString(property);
                if(StringUtils.isEmpty(key)) {
                    continue;
                }
                setValue(key, data.get(property));
            }
        } catch(Exception ex) {
            ex.printStackTrace();
        }
    }



    public String getId() {
        return this.id;
    }
    public void setId(String id) {
        this.id = id;
    }


    public Long getCreatetime() {
        return this.createtime;
    }
    public void setCreatetime(Long createtime) {
        this.createtime = createtime;
    }


    public String getPlay() {
        return this.play;
    }
    public void setPlay(String play) {
        this.play = play;
    }


    public String getPlayid() {
        return this.playid;
    }
    public void setPlayid(String playid) {
        this.playid = playid;
    }


    public Integer getMoney_old() {
        return this.money_old;
    }
    public void setMoney_old(Integer money_old) {
        this.money_old = money_old;
    }
    public String getMoney_oldToString(String pattern) {
        if(this.money_old==null)  return null;
        return this.money_old.toString();
    }


    public Integer getMoney_var() {
        return this.money_var;
    }
    public void setMoney_var(Integer money_var) {
        this.money_var = money_var;
    }
    public String getMoney_varToString(String pattern) {
        if(this.money_var==null)  return null;
        return this.money_var.toString();
    }


    public Integer getMoney_new() {
        return this.money_new;
    }
    public void setMoney_new(Integer money_new) {
        this.money_new = money_new;
    }
    public String getMoney_newToString(String pattern) {
        if(this.money_new==null)  return null;
        return this.money_new.toString();
    }


    public String getCreate_name() {
        return this.create_name;
    }
    public void setCreate_name(String create_name) {
        this.create_name = create_name;
    }


    public Date getCreate_dt() {
        return FormatUtils.clone(this.create_dt);
    }
    public void setCreate_dt(Date create_dt) {
        if(create_dt==null) {
            this.create_dt = null; 
        } else {
            this.create_dt = FormatUtils.clone(create_dt);
        }
    }
    public String getCreate_dtToString(String pattern) {
        if(this.create_dt==null)  return null;
        return FormatUtils.dateToString(this.create_dt, pattern);
    }


    public String getUpdate_name() {
        return this.update_name;
    }
    public void setUpdate_name(String update_name) {
        this.update_name = update_name;
    }


    public Date getUpdate_dt() {
        return FormatUtils.clone(this.update_dt);
    }
    public void setUpdate_dt(Date update_dt) {
        if(update_dt==null) {
            this.update_dt = null; 
        } else {
            this.update_dt = FormatUtils.clone(update_dt);
        }
    }
    public String getUpdate_dtToString(String pattern) {
        if(this.update_dt==null)  return null;
        return FormatUtils.dateToString(this.update_dt, pattern);
    }


    public String getDelete_flag() {
        return this.delete_flag;
    }
    public void setDelete_flag(String delete_flag) {
        this.delete_flag = delete_flag;
    }


    public String getDelete_name() {
        return this.delete_name;
    }
    public void setDelete_name(String delete_name) {
        this.delete_name = delete_name;
    }


    public Date getDelete_dt() {
        return FormatUtils.clone(this.delete_dt);
    }
    public void setDelete_dt(Date delete_dt) {
        if(delete_dt==null) {
            this.delete_dt = null; 
        } else {
            this.delete_dt = FormatUtils.clone(delete_dt);
        }
    }
    public String getDelete_dtToString(String pattern) {
        if(this.delete_dt==null)  return null;
        return FormatUtils.dateToString(this.delete_dt, pattern);
    }
    
    
    /**
     * 获得指定字段的值
     *     注意：字段名必须是小写字母
     * @return 返回字段对应的值
     */
    public Variant<?> getValue(String property) {
        if(StringUtils.isEmpty(property)) {
            return null;
        } else if("id".equalsIgnoreCase(property)) {
            return new Variant<String>(this.getId());
        } else if("createtime".equalsIgnoreCase(property)) {
            return new Variant<Long>(this.getCreatetime());
        } else if("play".equalsIgnoreCase(property)) {
            return new Variant<String>(this.getPlay());
        } else if("playid".equalsIgnoreCase(property)) {
            return new Variant<String>(this.getPlayid());
        } else if("money_old".equalsIgnoreCase(property)) {
            return new Variant<Integer>(this.getMoney_old());
        } else if("money_var".equalsIgnoreCase(property)) {
            return new Variant<Integer>(this.getMoney_var());
        } else if("money_new".equalsIgnoreCase(property)) {
            return new Variant<Integer>(this.getMoney_new());
        } else if("create_name".equalsIgnoreCase(property)) {
            return new Variant<String>(this.getCreate_name());
        } else if("create_dt".equalsIgnoreCase(property)) {
            return new Variant<Date>(this.getCreate_dt());
        } else if("update_name".equalsIgnoreCase(property)) {
            return new Variant<String>(this.getUpdate_name());
        } else if("update_dt".equalsIgnoreCase(property)) {
            return new Variant<Date>(this.getUpdate_dt());
        } else if("delete_flag".equalsIgnoreCase(property)) {
            return new Variant<String>(this.getDelete_flag());
        } else if("delete_name".equalsIgnoreCase(property)) {
            return new Variant<String>(this.getDelete_name());
        } else if("delete_dt".equalsIgnoreCase(property)) {
            return new Variant<Date>(this.getDelete_dt());
        } else {
            return null;
        }
    }
    public void setValue(String property, Object value) throws IOException {
        if(StringUtils.isEmpty(property)) {
        } else if("id".equalsIgnoreCase(property)) {
            this.setId(FormatUtils.toString(value));
        } else if("createtime".equalsIgnoreCase(property)) {
            this.setCreatetime(FormatUtils.toLong(value));
        } else if("play".equalsIgnoreCase(property)) {
            this.setPlay(FormatUtils.toString(value));
        } else if("playid".equalsIgnoreCase(property)) {
            this.setPlayid(FormatUtils.toString(value));
        } else if("money_old".equalsIgnoreCase(property)) {
            this.setMoney_old(FormatUtils.toInteger(value));
        } else if("money_var".equalsIgnoreCase(property)) {
            this.setMoney_var(FormatUtils.toInteger(value));
        } else if("money_new".equalsIgnoreCase(property)) {
            this.setMoney_new(FormatUtils.toInteger(value));
        } else if("create_name".equalsIgnoreCase(property)) {
            this.setCreate_name(FormatUtils.toString(value));
        } else if("create_dt".equalsIgnoreCase(property)) {
            this.setCreate_dt(FormatUtils.toDate(value));
        } else if("update_name".equalsIgnoreCase(property)) {
            this.setUpdate_name(FormatUtils.toString(value));
        } else if("update_dt".equalsIgnoreCase(property)) {
            this.setUpdate_dt(FormatUtils.toDate(value));
        } else if("delete_flag".equalsIgnoreCase(property)) {
            this.setDelete_flag(FormatUtils.toString(value));
        } else if("delete_name".equalsIgnoreCase(property)) {
            this.setDelete_name(FormatUtils.toString(value));
        } else if("delete_dt".equalsIgnoreCase(property)) {
            this.setDelete_dt(FormatUtils.toDate(value));
        }
    }
    
    public Map<String,Variant<?>> toMapVariant() {
        Map<String,Variant<?>> map = new org.apache.commons.collections4.map.CaseInsensitiveMap<String,Variant<?>>();
        map.put("id", getValue("id"));
        map.put("createtime", getValue("createtime"));
        map.put("play", getValue("play"));
        map.put("playid", getValue("playid"));
        map.put("money_old", getValue("money_old"));
        map.put("money_var", getValue("money_var"));
        map.put("money_new", getValue("money_new"));
        map.put("create_name", getValue("create_name"));
        map.put("create_dt", getValue("create_dt"));
        map.put("update_name", getValue("update_name"));
        map.put("update_dt", getValue("update_dt"));
        map.put("delete_flag", getValue("delete_flag"));
        map.put("delete_name", getValue("delete_name"));
        map.put("delete_dt", getValue("delete_dt"));
        return map;
    }
    public Map<String,Object> toMap() {
        Map<String,Object> map = new org.apache.commons.collections4.map.CaseInsensitiveMap<String,Object>();
        map.put("id", this.getId());
        map.put("createtime", this.getCreatetime());
        map.put("play", this.getPlay());
        map.put("playid", this.getPlayid());
        map.put("money_old", this.getMoney_old());
        map.put("money_var", this.getMoney_var());
        map.put("money_new", this.getMoney_new());
        map.put("create_name", this.getCreate_name());
        map.put("create_dt", this.getCreate_dt());
        map.put("update_name", this.getUpdate_name());
        map.put("update_dt", this.getUpdate_dt());
        map.put("delete_flag", this.getDelete_flag());
        map.put("delete_name", this.getDelete_name());
        map.put("delete_dt", this.getDelete_dt());
        return map;
    }
    
    public static String generateTablename() {
        return "player1_money";
    }
    
    
    /**
     * 获得当前对象的所有属性名
     *
     * @return 返回属性名数组
     */
    public String[] generateProperties() {
        return new String[]{"id","createtime","play","playid","money_old","money_var","money_new","create_name","create_dt","update_name","update_dt","delete_flag","delete_name","delete_dt"};
    }
    public static PropertyDescriptor[] generatePropertiesDesc() {
        return new PropertyDescriptor[] {
 new PropertyDescriptor(String.class, "id", "主键", null)
,  new PropertyDescriptor(Long.class, "createtime", "记账时间毫秒数，用于排序", null)
,  new PropertyDescriptor(String.class, "play", "游戏： play_stake, play_stake_pj, play_stake_pk, play_stake_pm, play_stake_3d1, play_stake_3d2", null)
,  new PropertyDescriptor(String.class, "playid", "对应游戏记录id", null)
,  new PropertyDescriptor(Integer.class, "money_old", "变动前余额，单位：分", null)
,  new PropertyDescriptor(Integer.class, "money_var", "余额变动，单位：分", null)
,  new PropertyDescriptor(Integer.class, "money_new", "变动后余额，单位：分", null)
,  new PropertyDescriptor(String.class, "create_name", "记录创建人", null)
,  new PropertyDescriptor(Date.class, "create_dt", "记录创建时间", null)
,  new PropertyDescriptor(String.class, "update_name", "记录最后修改人", null)
,  new PropertyDescriptor(Date.class, "update_dt", "记录最后修改时间", null)
,  new PropertyDescriptor(String.class, "delete_flag", "记录删除标识", null)
,  new PropertyDescriptor(String.class, "delete_name", "记录删除人", null)
,  new PropertyDescriptor(Date.class, "delete_dt", "记录删除时间", null)
                };
    }
    public PropertyDescriptor generateProperties(String property) {
        if(StringUtils.isEmpty(property)) {
            return null;
        } else if("id".equalsIgnoreCase(property)) {
            return new PropertyDescriptor(String.class, "id", "主键", this.getId());
        } else if("createtime".equalsIgnoreCase(property)) {
            return new PropertyDescriptor(Long.class, "createtime", "记账时间毫秒数，用于排序", this.getCreatetime());
        } else if("play".equalsIgnoreCase(property)) {
            return new PropertyDescriptor(String.class, "play", "游戏： play_stake, play_stake_pj, play_stake_pk, play_stake_pm, play_stake_3d1, play_stake_3d2", this.getPlay());
        } else if("playid".equalsIgnoreCase(property)) {
            return new PropertyDescriptor(String.class, "playid", "对应游戏记录id", this.getPlayid());
        } else if("money_old".equalsIgnoreCase(property)) {
            return new PropertyDescriptor(Integer.class, "money_old", "变动前余额，单位：分", this.getMoney_old());
        } else if("money_var".equalsIgnoreCase(property)) {
            return new PropertyDescriptor(Integer.class, "money_var", "余额变动，单位：分", this.getMoney_var());
        } else if("money_new".equalsIgnoreCase(property)) {
            return new PropertyDescriptor(Integer.class, "money_new", "变动后余额，单位：分", this.getMoney_new());
        } else if("create_name".equalsIgnoreCase(property)) {
            return new PropertyDescriptor(String.class, "create_name", "记录创建人", this.getCreate_name());
        } else if("create_dt".equalsIgnoreCase(property)) {
            return new PropertyDescriptor(Date.class, "create_dt", "记录创建时间", this.getCreate_dt());
        } else if("update_name".equalsIgnoreCase(property)) {
            return new PropertyDescriptor(String.class, "update_name", "记录最后修改人", this.getUpdate_name());
        } else if("update_dt".equalsIgnoreCase(property)) {
            return new PropertyDescriptor(Date.class, "update_dt", "记录最后修改时间", this.getUpdate_dt());
        } else if("delete_flag".equalsIgnoreCase(property)) {
            return new PropertyDescriptor(String.class, "delete_flag", "记录删除标识", this.getDelete_flag());
        } else if("delete_name".equalsIgnoreCase(property)) {
            return new PropertyDescriptor(String.class, "delete_name", "记录删除人", this.getDelete_name());
        } else if("delete_dt".equalsIgnoreCase(property)) {
            return new PropertyDescriptor(Date.class, "delete_dt", "记录删除时间", this.getDelete_dt());
        } else {
            return null;
        }
    }
    
    
    public Player1MoneyDomain cloneDomain() {
        return (Player1MoneyDomain)clone();
    }
    
    
    /**
     * @see Object#toString()
     */
    public String toString(){
        StringBuffer dto=new StringBuffer(1024);
        dto.append("id=").append(FormatUtils.toString(this.getId())).append(";");
        dto.append("createtime=").append(FormatUtils.toString(this.getCreatetime())).append(";");
        dto.append("play=").append(FormatUtils.toString(this.getPlay())).append(";");
        dto.append("playid=").append(FormatUtils.toString(this.getPlayid())).append(";");
        dto.append("money_old=").append(FormatUtils.toString(this.getMoney_old())).append(";");
        dto.append("money_var=").append(FormatUtils.toString(this.getMoney_var())).append(";");
        dto.append("money_new=").append(FormatUtils.toString(this.getMoney_new())).append(";");
        dto.append("create_name=").append(FormatUtils.toString(this.getCreate_name())).append(";");
        dto.append("create_dt=").append(FormatUtils.toString(this.getCreate_dt())).append(";");
        dto.append("update_name=").append(FormatUtils.toString(this.getUpdate_name())).append(";");
        dto.append("update_dt=").append(FormatUtils.toString(this.getUpdate_dt())).append(";");
        dto.append("delete_flag=").append(FormatUtils.toString(this.getDelete_flag())).append(";");
        dto.append("delete_name=").append(FormatUtils.toString(this.getDelete_name())).append(";");
        dto.append("delete_dt=").append(FormatUtils.toString(this.getDelete_dt())).append(";");
        return dto.toString();
    }
}
